2005-04-05 Tor Lillqvist <tml@novell.com>
+ * gdk/win32/gdkvisual-win32.c (_gdk_visual_init): Handle 16 colour
+ display mode. For some reason, in this mode GetDeviceCaps(BITSPIXEL)
+ returns 1 (but GetDeviceCaps(NUMCOLORS) does return 16). (#143415)
+
* gdk/win32/gdkvisual-win32.c (_gdk_visual_init): Don't force
24bpp GdkVisual on 32bpp displays. (#140706)
2005-04-05 Tor Lillqvist <tml@novell.com>
+ * gdk/win32/gdkvisual-win32.c (_gdk_visual_init): Handle 16 colour
+ display mode. For some reason, in this mode GetDeviceCaps(BITSPIXEL)
+ returns 1 (but GetDeviceCaps(NUMCOLORS) does return 16). (#143415)
+
* gdk/win32/gdkvisual-win32.c (_gdk_visual_init): Don't force
24bpp GdkVisual on 32bpp displays. (#140706)
2005-04-05 Tor Lillqvist <tml@novell.com>
+ * gdk/win32/gdkvisual-win32.c (_gdk_visual_init): Handle 16 colour
+ display mode. For some reason, in this mode GetDeviceCaps(BITSPIXEL)
+ returns 1 (but GetDeviceCaps(NUMCOLORS) does return 16). (#143415)
+
* gdk/win32/gdkvisual-win32.c (_gdk_visual_init): Don't force
24bpp GdkVisual on 32bpp displays. (#140706)
HBITMAP hbm;
const gint rastercaps = GetDeviceCaps (_gdk_display_hdc, RASTERCAPS);
+ const int numcolors = GetDeviceCaps (_gdk_display_hdc, NUMCOLORS);
gint bitspixel = GetDeviceCaps (_gdk_display_hdc, BITSPIXEL);
gint map_entries = 0;
system_visual = g_object_new (GDK_TYPE_VISUAL, NULL);
+ GDK_NOTE (COLORMAP, g_print ("BITSPIXEL=%d NUMCOLORS=%d\n",
+ bitspixel, numcolors));
+
if (rastercaps & RC_PALETTE)
{
const int sizepalette = GetDeviceCaps (_gdk_display_hdc, SIZEPALETTE);
- const int numcolors = GetDeviceCaps (_gdk_display_hdc, NUMCOLORS);
gchar *max_colors = getenv ("GDK_WIN32_MAX_COLORS");
system_visual->type = GDK_VISUAL_PSEUDO_COLOR;
- GDK_NOTE (COLORMAP, g_print ("BITSPIXEL=%d NUMCOLORS=%d SIZEPALETTE=%d\n",
- bitspixel, numcolors, sizepalette));
+ GDK_NOTE (COLORMAP, g_print ("SIZEPALETTE=%d\n", sizepalette));
g_assert (sizepalette == 256);
if (max_colors != NULL)
else
map_entries = sizepalette;
}
+ else if (bitspixel == 1 && numcolors == 16)
+ {
+ bitspixel = 4;
+ system_visual->type = GDK_VISUAL_STATIC_COLOR;
+ map_entries = 16;
+ }
else if (bitspixel == 1)
{
system_visual->type = GDK_VISUAL_STATIC_GRAY;